<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正则表达式</title>
</head>
<body>
<script>
    //5. 定义三个函数编写身份证号、手机号、邮箱的正则表达式并测试
    var reg = /^\d{17}(\d|X|x)$/;//身份证号码
    var tel = /^1\d{10}$/;//手机号码
    //var email = /^(\w{1,})@\w{1,}\.((\w{2,3}){1,2})$/;//邮箱
    var email = /^(\w{1,})@\w{1,}\.(\w{2,3})$/;//邮箱
    var email = /^(\d{5,12}@qq\.(\w{1,3}))$/;//QQ邮箱


    var usernamber = "412722199512011017";
    var telphone = "18838041343";
    var em = "14212@qq.com";

    alert(reg.test(usernamber));
    alert(tel.test(telphone));
    alert(email.test(em));


</script>


</body>
</html>